import request from '@/utils/request'


export function getTreeNodesByParentId(parentId) {
  return request({
    url: '/wms/assetCategory/getTreeNodesByParentId',
    params: {
      parentId
    },
    method: 'get'
  })
}

// 查询资产分类表列表
export function listAssetCategory(query, pageReq) {
  return request({
    url: '/wms/assetCategory/list',
    method: 'post',
    data: query,
    params: pageReq
  })
}

// 查询资产分类表列表
export function listAll() {
  return request({
    url: '/wms/assetCategory/listAll',
    method: 'get'
  })
}

// 查询资产分类表详细
export function getAssetCategory(id) {
  return request({
    url: '/wms/assetCategory/' + id,
    method: 'get'
  })
}

// 新增资产分类表
export function addAssetCategory(data) {
  return request({
    url: '/wms/assetCategory',
    method: 'post',
    data: data
  })
}

// 修改资产分类表
export function updateAssetCategory(data) {
  return request({
    url: '/wms/assetCategory',
    method: 'put',
    data: data
  })
}

// 删除资产分类表
export function delAssetCategory(id) {
  return request({
    url: '/wms/assetCategory/' + id,
    method: 'delete'
  })
}

// 导出资产分类表
export function exportAssetCategory(query) {
  return request({
    url: '/wms/assetCategory/export',
    method: 'get',
    params: query
  })
}

export default {
  getListAll() {
    return request({
      url: '/wms/assetCategory/listAll',
      method: 'get'
    })
  }
}
